b,w,h=map(int,input().split());z=[h]*w for _ in'.'*b: t,p,d=map(int,input().split());u=0;i=t while-1